<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>实际工器具</title>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
	<style type="text/css">
    	.detail{
    		padding-right: 20px!important;
    	}
    	h5{color: #0062CC;}
    </style>
</head>

<body>
    <div class="mui-content">
  		<div class="mui-card" id='mui-table-view'>
        <!-- 模板引擎 -->
      </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/common.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/template.js" type="text/javascript" charset="utf-8"></script>
<script type="text/temmlate" id="tmpList">
  {{each datas as item}}
    <ul class="mui-table-view mui-table-view-chevron" >
      <li class="mui-table-view-cell mui-collapse">
        <a class="mui-navigate-right" href="#">任务序号：{{item.wosequence}}
          <span class="mui-badge mui-badge-inverted">工具:{{item.toolDesc}}</span>
        </a>
        <ul class="mui-table-view mui-table-view-chevron">
          <li class="mui-table-view-cell">任务：{{item.taskDesc}}</li>
          <li class="mui-table-view-cell">工具描述：{{item.plusccomment}}</li>
          <li class="mui-table-view-cell">数量：{{item.toolqty}}</li>
          <!--<li class="mui-table-view-cell">工具小时数：{{item.toolhrs}}</li>
          <li class="mui-table-view-cell">费率：{{item.toolrate}}</li>
          <li class="mui-table-view-cell">行成本：{{item.linecost}}</li>-->
          <li class="mui-table-view-cell">位置：{{item.location}}</li>
        </ul>
      </li>
    </ul>
    <div class="mui-card-footer">
      <a class="mui-card-link" onclick="openToolActualEdit('{{item.tooltransid}}')">修改实际工具</a>
      <a class="mui-card-link"></a>
      <a class="mui-card-link">删除</a>
    </div>
  {{/each}}
</script>
<script type="text/javascript">
	apiready = function () {
    onLoadData(curPage,false);
		api.addEventListener({
		    name:'navitembtn'
		},function(ret, err){
		    if(ret.type == 'right'){
		    	openSaveWin('work_order_manage_toolActual_add','添加实际工器具',{
	            wonum:api.pageParam.wonum,
	            linetype:api.pageParam.linetype
	          })
		    }
	  })
    api.addEventListener({
        name: 'refersh'
    }, function(ret, err) {
      if (ret.value.isrefersh == 'yes') {
        loadEnd = false;
        curPage = 1;
        onLoadData(curPage,false);
      }
    });
	}
  function onLoadData (page,load) {
    ajaxrd("queryToolTransList", {
      wonum: api.pageParam.wonum,
      pageNo: curPage,
      pageSize: 10
    }, function(ret, err) {
      api.refreshHeaderLoadDone();
      if (ret.list) {
        AddData('tmpList','mui-table-view',ret.list,load);
        if (ret.list.length < 10) {
          loadEnd = true
        }
      } else {
        Toast('暂无数据！');
      }

    })
  }
  function  openToolActualEdit (id){
    openSaveWin('work_order_manage_toolActual_edit','修改实际工器具',{
        tooltransid: id
      })
  }
</script>

</html>
